<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        body {
            background-color: black;
        }
    </style>
    <script>
        var num = 1;

        function xingxing() {
            var x = Math.floor(Math.random() * 1024);
            var y = Math.floor(Math.random() * 768);
            document.getElementById('one').innerHTML = `<div style="position: absolute;left:${x}px;top:${y}px;z-index: ${num};">
            <img src="./xing.gif" width="30" height="30" alt="">
        </div>`
            x = Math.floor(Math.random() * 1024);
            y = Math.floor(Math.random() * 768);
            document.getElementById('two').innerHTML = `<div style="position: absolute;left:${x}px;top:${y}px;z-index: ${num};">
            <img src="./xing.gif" width="30" height="30" alt="">
        </div>`

            x = Math.floor(Math.random() * 1024);
            y = Math.floor(Math.random() * 768);
            document.getElementById('three').innerHTML = `<div style="position: absolute;left:${x}px;top:${y}px;z-index: ${num};">
            <img src="./xing.gif" width="30" height="30" alt="">
        </div>`
            x = Math.floor(Math.random() * 1024);
            y = Math.floor(Math.random() * 768);
            document.getElementById('four').innerHTML = `<div style="position: absolute;left:${x}px;top:${y}px;z-index: ${num};">
            <img src="./xing.gif" width="30" height="30" alt="">
        </div>`
            x = Math.floor(Math.random() * 1024);
            y = Math.floor(Math.random() * 768);
            document.getElementById('five').innerHTML = `<div style="position: absolute;left:${x}px;top:${y}px;z-index: ${num};">
            <img src="./xing.gif" width="30" height="30" alt="">
        </div>`
            num++;
            setTimeout(xingxing,500);
        }
    </script>
</head>

<body onload="xingxing()">
    <div id="one">
    </div>
    <div id="two">

    </div>
    <div id="three">

    </div>
    <div id="four">

    </div>
    <div id="five">

    </div>

</body>

</html>